/**
 * @author LKQ
 * @date 2022/2/15 11:25
 * @description
 */
public class Solution2 {
    public static void main(String[] args) {
        Solution2 solution = new Solution2();
        int[] nums = {2, 1, 3, 4};
        System.out.println(solution.check(nums));
    }
    public boolean check(int[] nums) {
        int n = nums.length;
        //有经过轮转
        boolean isCount = nums[0] >= nums[n-1];
        for(int i=1;i<n;i++){
            if(nums[i]<nums[i-1]){
                if(isCount){
                    isCount = false;
                }else{
                    return false;
                }
            }
        }
        return true;
    }

}
